<local:DocumentBase x:Class="WPFExcelReport.YCAABAUDIT"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"                   
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    
                    FontSize="16"
                    Loaded="Window_Loaded"
                    Background="White" 
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="Set4ITX" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwEXDECK" Source="{Binding Path=WDECK,Source={StaticResource Set4ITX}}" />
        <CollectionViewSource   x:Key="vwEXBOM" Source="{Binding Path=FDECK,Source={StaticResource Set4ITX}}" />
    </local:DocumentBase.Resources>
    <TabControl>
        <TabItem Header="{Binding Source={Localization:Translate Word=处理生产单}}">
            <Grid   >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="179.09"></ColumnDefinition>
                    <ColumnDefinition Width="20.91"/>
                    <ColumnDefinition Width="1000"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,0,0,103"
             >
                    <WrapPanel>
                        <TextBlock FontSize="18"    Height="40" Width="Auto" Name="txt1" VerticalAlignment="Center" Margin="0,0,0,0"  Text="{Binding Source={Localization:Translate Word=生产单}}" />
                        <TextBox Background="Yellow"  FontSize="18"    Width="50" Name="txtAUFKRS" CharacterCasing="Upper" Margin="10,0,0,0"
                     MaxLength="2" />
                        <TextBox Background="Pink" BorderBrush="Azure"  FontSize="18"    Margin="10,0,0,0" Width="102" Name="txtAUFLFD"  
                     MaxLength="6" />
                        <TextBox Background="White"  FontSize="18" Height="36"    Width="40" Name="txtAUFPOS"   Margin="15,0,0,0" >000</TextBox>
                        <TextBlock FontSize="18"  Height="40"   Width="Auto" Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=确认删除}}" />
                        <TextBox Background="White"  FontSize="18" Height="36"    Width="Auto" Name="txtDelete"   Margin="15,0,0,0" >N</TextBox>

                        <Button FontSize="18" Content="{Binding Source={Localization:Translate Word=查询}}"  BorderBrush="Yellow" Margin="20,0,0,0" Name="c" Click="btnQuery_Click" Height="40" Width="52"/>
                        <Button Content="{Binding Source={Localization:Translate Word=删除生产单}}"  FontSize="18"  BorderBrush="Yellow" Margin="20,0,0,0"  Width="Auto" Click="cmdDeleteAB_Click"/>
                    </WrapPanel>
                </StackPanel>
                <StackPanel Grid.Column="0" Grid.ColumnSpan="3" Margin="0,40,0,0" Grid.RowSpan="2" >
                    <TextBlock Name="listGS08N"></TextBlock>
                    <DataGrid CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                      MaxHeight="300"
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS}}"  
                              Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="" Binding="{Binding ABPAUFKRS}" Width="40"/>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产单}}" Binding="{Binding ABPAUFLFD}" Width="80"/>
                            <DataGridTextColumn Header="" Binding="{Binding ABPAUFPOS}" Width="40"/>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=品种}}" Binding="{Binding ABPART}" Width="160"/>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=色号}}" Binding="{Binding ABPFARBE}" Width="80"/>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=尺寸}}" Binding="{Binding ABPGROE}" Width="80"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=原料已在BOM删除}}"
            >
            <Grid   >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200"></ColumnDefinition>
                    <ColumnDefinition Width="1000"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
             >
                    <WrapPanel>
                        <Button FontSize="18" Content="{Binding Source={Localization:Translate Word=查询}}"  BorderBrush="Yellow" Margin="20,0,0,0"  Click="btnQuery2_Click" Height="40" Width="52"/>
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=查询在生产单存在的原料，但是在标准BOM中已经删除}}">
                           
                        </TextBlock>
                    </WrapPanel>
                </StackPanel>

                <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" >

                    <DataGrid CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                      MaxHeight="600"
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwEXDECK}}"  
                              Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=生产单}}" Binding="{Binding ABPAUFLFD}" Width="80"/>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=品种}}" Binding="{Binding ABPART}" Width="160"/>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=原料}}" Binding="{Binding MART}" Width="160"/>                            
                        </DataGrid.Columns>
                    </DataGrid  >
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=BOM原料未添加}}"
            >
            <Grid   >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200"></ColumnDefinition>
                    <ColumnDefinition Width="1000"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
             >
                    <WrapPanel>
                        <Button FontSize="18" Content="{Binding Source={Localization:Translate Word=更新}}"  BorderBrush="Yellow" Margin="20,0,0,0"  Click="btnQuery3_Click" Height="40" Width="52"/>
                        <TextBlock VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=查询在BOM中已经存在，但是在生产单中没有}}">
                           
                    </TextBlock>
                    </WrapPanel>
                </StackPanel>

                <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" >

                    <DataGrid CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                      MaxHeight="600"
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwEXBOM}}"  
                              Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=款式}}" Binding="{Binding FSSART}" Width="160"/>
                            <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=原料}}" Binding="{Binding FSSMART}" Width="160"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                </StackPanel>
            </Grid>
        </TabItem>
    </TabControl>
</local:DocumentBase>
